<?php
$config = [
    'aliases' => [
        '@bower' => '@vendor/bower-asset',
        '@npm'   => '@vendor/npm-asset',
    ],
    'timeZone' => 'Asia/Shanghai',
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'components' => [
        // 系统设置
        'setting' => [
            'class' => 'common\models\SettingService',
        ],
        // 短信组件
        'sms' => [
            'class' => 'common\components\sms\SMS',
            'smsSign' => 'Yii Manager Builder',
            'sender' => [
                'class' => 'common\components\sms\sender\Feige',
                'apikey' => 'xxxxxx',
                'secret' => 'xxxxxx',
                'sign_id' => 'xxxxxx',
                'apiUrl' => 'xxxxxx',
            ],
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'i18n' => [
            'translations' => [
                'app*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@messages',
                    'sourceLanguage' => 'en-US',
                    'fileMap' => [
                        'app.backend' => 'backend.php',
                        'app.frontend' => 'frontend.php',
                        'app.common' => 'common.php'
                    ],
                ],
            ],
        ],
    ],
];

if (PHP_SAPI !== 'cli') {
    // 更改x-powered-by
    $config['components']['response'] = [
        'as x-powered-by-modify' => 'builder\behaviors\XPoweredByBehavior',
    ];
}

return $config;
